package com.panasonic.cn.cmsc;

import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.sql.SQLException;
import com.fujitsu.fks.jaaf.core.*;

public class SQLMMDLNO06{
	private Hashtable paramsString     = new Hashtable();
	private Hashtable paramsBigDecimal = new Hashtable();
	private Hashtable paramsFree       = new Hashtable();
	private String lastSql_ = null;

	private String getString(String name){
		if(name==null) return "";
		String returnStr = (String)paramsString.get(name);
		if(returnStr==null) return "";
		return "'"+FrameworkCommon.stringReplaceSQuote(returnStr)+"'";
	}

	private String getBigDecimal(String name){
		if(name==null) return "";
		BigDecimal returnStr = (BigDecimal)paramsBigDecimal.get(name);
		if(returnStr==null) return "";
		return returnStr.toString();
	}

	private String getFree(String name){
		if(name==null) return "";
		String returnStr = (String)paramsFree.get(name);
		if(returnStr==null) return "";
		return returnStr;
	}

	public String getLastSql(){
		return lastSql_;
	}

	public SelectResultRset select_DLNO01(FrameworkDbCommon db) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append("  SELECT");
		sql.append("  NVL(AC_END_DT,' ') AS AC_END_DT,");
		sql.append("  NVL(DCAT_CD,' ') AS DCAT_CD,");
		sql.append("  NVL(TMP_AC_TYP,' ') AS TMP_AC_TYP,");
		sql.append("  NVL(A_NOIG_DVSN_CD,' ') AS A_NOIG_DVSN_CD,");
		sql.append("  NVL(M_PRNT_DVSN_CD,' ') AS M_PRNT_DVSN_CD,    ");
		sql.append("  NVL(JPN_SLS_TYP,' ') AS JPN_SLS_TYP,");
		sql.append("  NVL(EUR_SLS_TYP,' ') AS EUR_SLS_TYP,");
		sql.append("  NVL(ASA_SLS_TYP,' ') AS ASA_SLS_TYP,");
		sql.append("  NVL(AMRS_SLS_TYP,' ') AS AMRS_SLS_TYP,");
		sql.append("  NVL(JPN_MFC_TYP,' ') AS JPN_MFC_TYP,");
		sql.append("  NVL(EUR_MFC_TYP,' ') AS EUR_MFC_TYP,");
		sql.append("  NVL(ASA_MFC_TYP,' ') AS ASA_MFC_TYP,");
		sql.append("  NVL(AMRS_MFC_TYP,' ') AS AMRS_MFC_TYP,");
		sql.append("  NVL(FGD_TYP,' ') AS FGD_TYP,");
		sql.append("  NVL(PSRC_TYP,' ') AS PSRC_TYP,");
		sql.append("  NVL(SMDL_TYP,' ') AS SMDL_TYP,");
		sql.append("  NVL(ITM_NO_PTC_TYP,' ') AS ITM_NO_PTC_TYP,");
		sql.append("  NVL(ST_TYP_TYP,' ') AS ST_TYP_TYP,");
		sql.append("  NVL(DMY_TYP_TYP,' ') AS DMY_TYP_TYP,");
		sql.append("  NVL(M_PT_SYBL_TYP,' ') AS M_PT_SYBL_TYP,");
		sql.append("  NVL(PT_TYP,' ') AS PT_TYP,");
		sql.append("  NVL(PRD_BDT,' ') AS PRD_BDT,");
		sql.append("  NVL(PRD_EDT,' ') AS PRD_EDT,");
		sql.append("  NVL(PLRL_SLS_TYP,' ') AS PLRL_SLS_TYP,");
		sql.append("  NVL(SLS_DVSN_CD,' ') AS SLS_DVSN_CD,");
		sql.append("  NVL(I_N_R_PRMS_TYP,' ') AS I_N_R_PRMS_TYP,");
		sql.append("  NVL(ITM_NM1,' ') AS ITM_NM1,");
		sql.append("  NVL(ITM_NM2,' ') AS ITM_NM2,");
		sql.append("  NVL(MCD_PT_SYBL_CD,' ') AS MCD_PT_SYBL_CD,");
		sql.append("  NVL(JPN_POS_TYP,' ') AS JPN_POS_TYP,");
		sql.append("  NVL(JPN_POS_CD,' ') AS JPN_POS_CD,");
		sql.append("  NVL(EUR_POS_TYP,' ') AS EUR_POS_TYP,");
		sql.append("  NVL(EUR_POS_CD,' ') AS EUR_POS_CD,");
		sql.append("  NVL(ASA_POS_TYP,' ') AS ASA_POS_TYP,");
		sql.append("  NVL(ASA_POS_CD,' ') AS ASA_POS_CD,");
		sql.append("  NVL(LTAM_POS_TYP,' ') AS LTAM_POS_TYP,");
		sql.append("  NVL(LTAM_POS_CD,' ') AS LTAM_POS_CD,");
		sql.append("  NVL(NAMR_POS_TYP,' ') AS NAMR_POS_TYP,");
		sql.append("  NVL(NAMR_POS_CD,' ') AS NAMR_POS_CD,");
		sql.append("  NVL(E_RGN_POS_TYP,' ') AS E_RGN_POS_TYP,");
		sql.append("  NVL(ETC_RGN_POS_CD,' ') AS ETC_RGN_POS_CD,");
		sql.append("  NVL(O_CPRS_ITM_NO,' ') AS O_CPRS_ITM_NO,");
		sql.append("  NVL(O_CPRS_ITM_CD,' ') AS O_CPRS_ITM_CD  ");
		sql.append("  FROM");
		sql.append("  MDLNO");
		sql.append("  WHERE   ");
		sql.append("  UNI_ITM_NO "+((getString("UNI_ITM_NO").equals(""))?" is null ":"=")+getString("UNI_ITM_NO")+"");
		sql.append("  AND U_I_NO_DSTC_CD "+((getString("U_I_NO_DSTC_CD").equals(""))?" is null ":"=")+getString("U_I_NO_DSTC_CD")+"");
		sql.append("  AND APL_BDT "+((getString("APL_BDT").equals(""))?" is null ":"=")+getString("APL_BDT")+"");
		db.setSql(sql.toString());
		lastSql_ =sql.toString();
		SelectResultRset srr = db.executeQuery();
		paramsString     = new Hashtable();
		paramsBigDecimal = new Hashtable();
		paramsFree       = new Hashtable();

		return srr;
	}


	public void setUNI_ITM_NO(String value){
		if(value==null) {
			paramsString.remove("UNI_ITM_NO");
			return;
		}
		paramsString.put("UNI_ITM_NO",value);
	}


	public void setU_I_NO_DSTC_CD(String value){
		if(value==null) {
			paramsString.remove("U_I_NO_DSTC_CD");
			return;
		}
		paramsString.put("U_I_NO_DSTC_CD",value);
	}


	public void setAPL_BDT(String value){
		if(value==null) {
			paramsString.remove("APL_BDT");
			return;
		}
		paramsString.put("APL_BDT",value);
	}


}
